#ifndef COLORED_STREAM_H
#define COLORED_STREAM_H

enum color { BLACK = 0, BLUE, GREEN, AQUA, RED,
             PURPLE, YELLOW, LIGHT_GREY,
             GREY, LIGHT_BLUE, LIGHT_GREEN,
             LIGHT_AQUA, LIGHT_RED, LIGHT_PURPLE,
             LIGHT_YELLOW, WHITE };

namespace cgl {
    void text_color( color, color );
    void reset_color();
};

using namespace cgl;

class Colored_stream
{
    public:
        Colored_stream( color txt = GREY, color bg = BLACK )
            :txt_( txt ), background_( bg )
        {}
        virtual ~Colored_stream() {}
        // getters
        color txt_color() { return txt_; }
        color bg_color() { return background_; }
        // setters
        void set_color( color text, color background ) {
            txt_ = text;
            background_ = background;
        }
        void set_txt_color( color i ) { txt_ = i; }
        void set_bg_color( color i ) { background_ = i; }
        // functions, which work with color
        void enable_color() { text_color( txt_, background_ ); }
        void disable_color() { reset_color(); }
    protected:
    private:
        // text and background colors
        color txt_;
        color background_;
};

#endif // COLORED_STREAM_H
